<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<script src="../vue.js"></script>

<body>
  <div id="app">
    <input type="text" @keyup.enter="submit" name="" id="" v-model="inputValue">
  </div>
  <script>
    const vm = new Vue({
      el: "#app",
      data: {
        inputValue: ""
      },
      methods: {
        submit() {
          console.log("表单提交数据为" + this.inputValue + "！");
        }
      }
    })
  </script>
</body>

</html>